package com.wx.callback;

import com.wx.callback.impl.MyFetcher;
import lombok.extern.slf4j.Slf4j;

/**
 * 回调
 *
 * @author wang.xun
 * @date 2023/11/09
 */
@Slf4j
public class Worker {
    void doWork(){
        Data data = new Data(1, 2);
        MyFetcher myFetcher = new MyFetcher(data);


        myFetcher.FetchData(new CallBack() {


            @Override
            public void onExecute(Data data) {
                log.info("正确的结果data:{}",data);
            }

            @Override
            public void onError(Data data) {
                log.error("错误的结果data:{}",data);
            }
        });
    }

    public static void main(String[] args) {
        new Worker().doWork();

    }
}
